Skip to content

Add sanitizers job - #57

Open
bratpiorka wants to merge 1 commit into
oneapi-src:mainfrom
bratpiorka:rrudnick_rustc_flags
Open

bratpiorka wants to merge 1 commit into
oneapi-src:mainfrom
bratpiorka:rrudnick_rustc_flags

Conversation

@bratpiorka

Copy link
Copy Markdown
Contributor

Add a new sanitizers job that builds and tests the project using Rust nightly with hardening flags and runs tests with AddressSanitizer and LeakSanitizer enabled. The job is configured to run only on CPU devices to avoid compatibility issues with GPU drivers and sanitizers.

@szymon-zadworny szymon-zadworny left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm but I have some concerns regarding OpenCL runtime leak suppression. Also - this job takes the longest to complete. This is probably caused by having to install the nightly toolchain, but it's also worth checking whether all the sanitizer flags (e.g. fast_unwind_on_malloc) are actually necessary.

Image

Comment thread .github/workflows/basic.yml Outdated
ASAN_OPTIONS: fast_unwind_on_malloc=0
LSAN_OPTIONS: suppressions=${{ github.workspace }}/.github/lsan-suppressions.txt:fast_unwind_on_malloc=0
run: |
for sanitizer in address leak; do

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comment thread .github/workflows/basic.yml Outdated
env:
# Test only CPU to avoid issues with GPU drivers and sanitizers
ONEAPI_DEVICE_SELECTOR: opencl:cpu
ASAN_OPTIONS: fast_unwind_on_malloc=0

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need to disable fast unwind?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I might be wrong on this but if the OpenCL runtime manages all allocations then all SYCL-related leaks will happen inside the runtime. If we suppress this then we won't get any leak reports caused by wrong runtime usage by the C++ shims/Rust bindings.

@bratpiorka

Copy link
Copy Markdown
Contributor Author

@szymon-zadworny "this job takes the longest to complete. This is probably caused by having to install the nightly toolchain, but it's also worth checking whether all the sanitizer flags (e.g. fast_unwind_on_malloc) are actually necessary." - This took a long time due to the oneAPI installation (the first run after cleaning up the home directory), subsequent runs are much faster. See: https://github.com/oneapi-src/oneapi-rs/actions/runs/38898710914/job/118632140763?pr=57

@bratpiorka
bratpiorka force-pushed the rrudnick_rustc_flags branch 3 times, most recently from 706fceb to 945b4e9 Compare October 20, 2026 13:50

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants